package com.ruoyi.message.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.message.mapper.GroupUserMapper;
import com.ruoyi.message.domain.GroupUser;
import com.ruoyi.message.service.IGroupUserService;

/**
 * 群Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-19
 */
@Service
public class GroupUserServiceImpl implements IGroupUserService 
{
    @Autowired
    private GroupUserMapper groupUserMapper;

    /**
     * 查询群
     * 
     * @param id 群主键
     * @return 群
     */
    @Override
    public GroupUser selectGroupUserById(Long id)
    {
        return groupUserMapper.selectGroupUserById(id);
    }

    /**
     * 查询群列表
     * 
     * @param groupUser 群
     * @return 群
     */
    @Override
    public List<GroupUser> selectGroupUserList(GroupUser groupUser)
    {
        return groupUserMapper.selectGroupUserList(groupUser);
    }

    /**
     * 新增群
     * 
     * @param groupUser 群
     * @return 结果
     */
    @Override
    public int insertGroupUser(GroupUser groupUser)
    {
        groupUser.setCreateTime(DateUtils.getNowDate());
        return groupUserMapper.insertGroupUser(groupUser);
    }

    /**
     * 修改群
     * 
     * @param groupUser 群
     * @return 结果
     */
    @Override
    public int updateGroupUser(GroupUser groupUser)
    {
        return groupUserMapper.updateGroupUser(groupUser);
    }

    /**
     * 批量删除群
     * 
     * @param ids 需要删除的群主键
     * @return 结果
     */
    @Override
    public int deleteGroupUserByIds(Long[] ids)
    {
        return groupUserMapper.deleteGroupUserByIds(ids);
    }

    /**
     * 删除群信息
     * 
     * @param id 群主键
     * @return 结果
     */
    @Override
    public int deleteGroupUserById(Long id)
    {
        return groupUserMapper.deleteGroupUserById(id);
    }
}
